package models

// MemberRole [...]
type MemberRole struct {
	MemberID uint   `gorm:"index:member_role_ibfk_1;column:member_id;type:int unsigned;not null" json:"memberId"`
	Member   Member `gorm:"joinForeignKey:member_id;foreignKey:id" json:"memberList"` // 管理员表
	RoleID   uint   `gorm:"index:member_role_ibfk_2;column:role_id;type:int unsigned;not null" json:"roleId"`
	Role     Role   `gorm:"joinForeignKey:role_id;foreignKey:id" json:"roleList"`
}

// TableName get sql table name.获取数据库表名
func (m *MemberRole) TableName() string {
	return "member_role"
}

// MemberRoleColumns get sql column name.获取数据库列名
var MemberRoleColumns = struct {
	MemberID string
	RoleID   string
}{
	MemberID: "member_id",
	RoleID:   "role_id",
}
